<template>
  <!-- <el-tooltip
    class="item"
    effect="dark"
    :content="label"
    placement="top"
    :enterable="false"
    :disabled="!tips"
  >
    <el-button
      :type="type"
      :size="size"
      :icon="iconFormat"
      @click="$emit('click')"
    >
      <template v-if="!tips">
        {{ label }}
      </template>
    </el-button>
  </el-tooltip> -->
  <el-button
      :type="type"
      :size="size"
      :icon="iconFormat"
      @click="$emit('click')"
    >
        <template v-if="label">
          {{ label }}
        </template>
    </el-button>
</template>

<script>
export default {
  name: "y-button",
  props: {
    type: {
      type: String,
      default: "primary",
    },
    icon: String,
    label: String,
    tips: {
      type: Boolean,
      default: false,
    },
    size: {
      type: String,
      default: "small",
    },
  },
  computed: {
    iconFormat() {
      let icon = this.icon;
      switch (icon) {
        case "add":
          icon = "plus";
          break;
      }
      if(icon)
        return "el-icon-" + icon;
      return
    },
  },
  created() {},
};
</script>

<style lang="scss" scoped>
</style>